from datetime import datetime

from sqlalchemy import DateTime, Integer, String
from sqlalchemy.orm import mapped_column, Mapped

from app.models.base import Base


class Users(Base):  # 用户表
    __tablename__ = "users"

    id: Mapped[int] = mapped_column(Integer, primary_key=True)
    name: Mapped[str] = mapped_column(String(191))
    email: Mapped[str] = mapped_column(String(191), unique=True)
    password: Mapped[str] = mapped_column(String(191))
    phone: Mapped[str] = mapped_column(String(191), unique=True)
    username: Mapped[str] = mapped_column(String(191), unique=True)
    avatar: Mapped[str] = mapped_column(String(191), comment="头像")
    deleted_at: Mapped[datetime] = mapped_column(DateTime)
    created_at: Mapped[datetime] = mapped_column(DateTime)
    updated_at: Mapped[datetime] = mapped_column(DateTime)
